<?php 
include_once("clases/Conexion.php");
include_once("clases/ItemManager.php");

$link = new Conexion("localhost","root", "root", "menues");
$objitem = new ItemManager();
$array_item = $objitem->getItem($_GET['id']);


?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="css/style.css" rel="stylesheet" type="text/css"  />
 <script type="text/javascript" src="./js/jquery.easing.1.3.js"></script>
 <script type="text/javascript" src="./js/cargarCombo.js"></script>
 <script type="text/javascript" src="./js/cargarCombo.js"></script>
 <script type="text/javascript" src="./js/jquery-latest.js"></script>
        <link rel="stylesheet" href="css/thickbox.css" type="text/css" />
        <script type="text/javascript" src="./js/thickbox.js"></script>
 <script type="text/javascript" src="./js/validarFormularioItems.js"></script>
</head>

    <body onload="cargarSubmenuEnEditItem();">
    <center>
        <fieldset>
           <legend>Editar Item</legend>
             <form name="frmitem" method="post" enctype="multipart/form-data" action="index.php?accion=updateItem">
               <input type="hidden" name="id" value="<?php echo $array_item[0]['id'] ?>" />
               <input type="hidden" id="idsubmenu" name="idsubmenu" value="<?php echo $array_item[0]['idsubmenu'] ?>" />
               <input type="hidden" name="tituloOld" value="<?echo $array_item[0]['titulo2']?>"/>
               <label>Menú Padre:</label><br/>
                <select id="buscarSubMenu" name="idmenu">

                </select><br/>
              <table id="TablaItemSubmenu" align="center">
                  <tr id="rowIcono">
                    <td>
                        <label>Titulo:</label>
                    </td>
                    <td>
                        <input type="text" name="titulo2" id="titulo2" value="<?php echo $array_item[0]['titulo2'] ?>"/>
                    </td>
                  </tr>
                  <tr id="rowIcono">
                    <td>
                        <label>Icono Actual:</label>
                    </td>
                    <td>
                        <img src="<?php echo $array_item[0]['icono'] ?>" />
                    </td>
                  </tr>
                  <tr>
                    <td>
                        <label>Modificar Icono:</label>
                    </td>
                    <td>
                        <input type="file" name="icono1" id="icono" accept="image"/>
                    </td>
                  </tr>

              </table><br/><br/>
               <input type="button" name="btnregresar" value=":: REGRESAR ::" onclick="javascript:self.parent.tb_remove('I');" />
               <input type="button" name="btngrabar" value=":: ACTUALIZAR ::" onclick="javascript:validarFormItems('I');"/><br/><br/>
             </form>
        </fieldset>
    </center>
</body>
</html>